package com.ruoyi.credit.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.credit.mapper.ContractIncomeMapper;
import com.ruoyi.credit.domain.ContractIncome;
import com.ruoyi.credit.service.IContractIncomeService;
import com.ruoyi.common.core.text.Convert;

/**
 * 收入类合同Service业务层处理
 * 
 * @author zhulei
 * @date 2022-03-10
 */
@Service
public class ContractIncomeServiceImpl implements IContractIncomeService 
{
    @Autowired
    private ContractIncomeMapper contractIncomeMapper;

    /**
     * 查询收入类合同
     * 
     * @param id 收入类合同主键
     * @return 收入类合同
     */
    @Override
    public ContractIncome selectContractIncomeById(Long id)
    {
        return contractIncomeMapper.selectContractIncomeById(id);
    }

    /**
     * 查询收入类合同列表
     * 
     * @param contractIncome 收入类合同
     * @return 收入类合同
     */
    @Override
    public List<ContractIncome> selectContractIncomeList(ContractIncome contractIncome)
    {
        return contractIncomeMapper.selectContractIncomeList(contractIncome);
    }

    /**
     * 新增收入类合同
     * 
     * @param contractIncome 收入类合同
     * @return 结果
     */
    @Override
    public int insertContractIncome(ContractIncome contractIncome)
    {
        return contractIncomeMapper.insertContractIncome(contractIncome);
    }

    /**
     * 修改收入类合同
     * 
     * @param contractIncome 收入类合同
     * @return 结果
     */
    @Override
    public int updateContractIncome(ContractIncome contractIncome)
    {
        return contractIncomeMapper.updateContractIncome(contractIncome);
    }

    /**
     * 批量删除收入类合同
     * 
     * @param ids 需要删除的收入类合同主键
     * @return 结果
     */
    @Override
    public int deleteContractIncomeByIds(String ids)
    {
        return contractIncomeMapper.deleteContractIncomeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除收入类合同信息
     * 
     * @param id 收入类合同主键
     * @return 结果
     */
    @Override
    public int deleteContractIncomeById(Long id)
    {
        return contractIncomeMapper.deleteContractIncomeById(id);
    }
}
